/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.axiom.utility;

import java.util.HashMap;
import java.util.Map;
import org.hibernate.ScrollableResults;

/**
 *
 * @author Shuhail
 */
public class ScrollUtility {
    
    public static ScrollUtility getInstance() {
        
        return new ScrollUtility();
    }
    
    
    public Map<String,String> convertToMapStudentCourse(ScrollableResults res) {
        int i=0;
        Map<String,String> map = new HashMap<String, String>();
        while(res.next()) {
            i++;
            map.put(res.get(0).toString()+":::"+res.get(1).toString(),res.get(2).toString()+":::"+res.get(3).toString()+":::"+res.get(4).toString()+":::"+res.get(5).toString()+":::"+ res.get(6).toString());
        }
        
        System.out.println(map);
        return map;
    }
    
    
    public Map<String,String> convertToMapInstructorCourse(ScrollableResults res) {
        
        int i=0;
        Map<String,String> map = new HashMap<String, String>();
        while(res.next()) {
            i++;
            map.put(res.get(0)+":::"+res.get(1),res.get(2)+":::"+res.get(3));
        }
        
        System.out.println(map);
        return map;
    }
    
    
    
    
    
}
